package game.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fank
 * @date 2018-08-20 12:54
 * @desc 游戏结果
 **/
public class GameResult {

    /**每次消除中的线和填充数据*/
    private List<Result> results = new ArrayList<>();
    /**点击旋转后的棋盘排列*/
    private List<Integer> sequen = new ArrayList<>();
    private long totalFen = 0;
    /**总押注*/
    @JsonIgnore
    private long totalBet = 0;
    /**当前结果是否是免费转*/
    private boolean cFree = false;
    /**购买花费*/
    @JsonIgnore
    private long cost = 0;
    /**小游戏列表*/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<MGameVo> mlist;
    /**当前金币(不包含小游戏)*/
    private long money;
    /**中奖类型*/
    private int rewardType;

    public GameResult(long totalBet, boolean cFree) {
        this.totalBet = totalBet;
        this.cFree = cFree;
    }

    public void addMlist(MGameVo vo) {
        if (mlist == null) {
            mlist = new ArrayList<>();
        }
        mlist.add(vo);
    }

    public List<Result> getResults() {
        return results;
    }

    public void setResults(List<Result> results) {
        this.results = results;
    }

    public List<Integer> getSequen() {
        return sequen;
    }

    public void setSequen(List<Integer> sequen) {
        this.sequen = sequen;
    }

    @JsonIgnore
    public Result getLastResult() {
        return results.get(results.size() - 1);
    }

    public void add(Result result, long fen) {
        results.add(result);
        totalFen += fen;
    }

    @JsonIgnore
    public int getCombo() {
        return results.size();
    }

    public long getTotalFen() {
        return totalFen;
    }

    public void setTotalFen(long totalFen) {
        this.totalFen = totalFen;
    }

    public long getTotalBet() {
        return totalBet;
    }

    public void setTotalBet(long totalBet) {
        this.totalBet = totalBet;
    }

    public boolean iscFree() {
        return cFree;
    }

    public void setcFree(boolean cFree) {
        this.cFree = cFree;
    }

    public long getCost() {
        return cost;
    }

    public void setCost(long cost) {
        this.cost = cost;
    }

    public List<MGameVo> getMlist() {
        return mlist;
    }

    public void setMlist(List<MGameVo> mlist) {
        this.mlist = mlist;
    }

    public long getMoney() {
        return money;
    }

    public void setMoney(long money) {
        this.money = money;
    }

    public int getRewardType() {
        return rewardType;
    }

    public void setRewardType(int rewardType) {
        this.rewardType = rewardType;
    }
}
